<template>
	<a-auto-complete v-model:value="value" :options="options" style="width: 200px" placeholder="input here" @select="onSelect" @search="onSearch">
		<template #option="{ name }">
			{{ name }}
		</template>
	</a-auto-complete>
</template>
<script setup name="userComplete">
	import { ref, watch } from 'vue'
	import userSelectorPlusApi from '@/api/components/Selector/userSelectorPlusApi'
	// 接收属性
	const props = defineProps({
		pageUrl: { type: String, default: '/flw/model/userSelector' }
	})
	const value = ref('')
	const options = ref([])
	const onSearch = (searchText) => {
		const param = {
			searchKey: searchText
		}
		userSelectorPlusApi.userSelector(props.pageUrl, param).then((res) => {
			options.value = res
		})
	}
	const onSelect = (data) => {}
</script>
